package com.aki.ai_property.controller;

import com.aki.ai_property.entity.House;
import com.aki.ai_property.entity.SellHouse;
import com.aki.ai_property.service.intf.SellHouseService;
import com.aki.ai_property.vo.PageBean;
import com.aki.ai_property.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author:WuChuangChuang
 * Date:2022/8/30 18:47
 */
@RestController
@RequestMapping("/api/sellhouse")
public class SellHouseController {
    @Autowired
    private SellHouseService service;
    /** 新增 */
    @PostMapping("/save.do")
    public Result save(SellHouse sellHouse){
        return service.save(sellHouse);
    }

    /** 修改 */
    @PostMapping("/update.do")
    public Result update(SellHouse sellHouse){
        return service.update(sellHouse);
    }

    /** 删除 */
    @PostMapping("/delete.do")
    public Result delete(int id){
        return service.delete(id);
    }

    /** 查询 */
    @GetMapping("/all.do")
    public PageBean selectPage(String houseType, int page, int limit){
        return service.selectPage(houseType,page,limit);
    }

}
